package com.yanmaohu.yulia.bean;

/**
 * @author Bright Lee
 */
public final class IsolationLevel implements TransactionMode {

    private int beginIndex;
    private int endIndex;
    private boolean readUncommitted;
    private boolean readCommitted;
    private boolean repeatableRead;
    private boolean serializable;

    public IsolationLevel(int beginInex, int endIndex, boolean readUncommitted, boolean readCommitted, boolean repeatableRead, boolean serializable) {
        this.beginIndex = beginInex;
        this.endIndex = endIndex;
        this.readUncommitted = readUncommitted;
        this.readCommitted = readCommitted;
        this.repeatableRead = repeatableRead;
        this.serializable = serializable;
    }

    @Override
    public int getBeginIndex() {
        return beginIndex;
    }

    @Override
    public int getEndIndex() {
        return endIndex;
    }

    public boolean isReadUncommitted() {
        return readUncommitted;
    }

    public boolean isReadCommitted() {
        return readCommitted;
    }

    public boolean isRepeatableRead() {
        return repeatableRead;
    }

    public boolean isSerializable() {
        return serializable;
    }

}
